<?php

declare(strict_types=1);
/**
 * @copyright 深圳市易果网络科技有限公司
 * @version 1.0.0
 * @link https://dayiguo.com
 */
namespace App\Request\User\Auth;

use App\Request\RequestAbstract;

/**
 * 登陆验证器
 *
 * @author 刘兴永(aile8880@qq.com)
 * @package App\Controller\admin
 */
class LoginRequest extends RequestAbstract
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'phone' => ['required', 'regex:/^1[3456789]\d{9}$/'],
            'code' => 'required|digits:6',
            'login_pwd' => 'required|confirmed',
            'login_pwd_confirmation' => 'required|same:login_pwd',
            'invitation_code' => 'size:6'
        ];
    }
}
